Collision data processing method and apparatus, computer device, and storage medium

ABSTRACT

A collision data processing method includes: determining, based on a physical engine detecting that a first rigid body having a first physical attribute collides with a second rigid body having a second physical attribute, an initial cutting model from a first model corresponding to the first rigid body and a second model corresponding to the second rigid body based on the first physical attribute and the second physical attribute, capturing, by the physical engine, a collision point between the first rigid body and the second rigid body, and determining normal vector information corresponding to the collision point based on collision data, and determining a first cutting surface in the initial cutting model based on the collision point, the normal vector information, and model information of the initial cutting model, and cutting the initial cutting model based on the first cutting surface to obtain cutting data.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of InternationalApplication No. PCT/CN2022/079809, filed on Mar. 9, 2022, which claimspriority to Chinese Patent Application No. 202110352747.3, filed withthe China National Intellectual Property Administration on Mar. 31,2021, the disclosures of each of which being incorporated by referenceherein in their entireties.

FIELD

The disclosure relates to the field of computer technology, and inparticular, to a dynamic image rendering technology.

BACKGROUND

At present, design users need to construct collision simulation modelsbased on multiple independent models in a computer device with asimulation environment. For example, for a virtual building (e.g. awall) in a game, a design user usually needs to place a large number ofindependent models (e.g. bricks) at corresponding positions in sequence,so as to construct the wall. The entire building process takes moretime, and will take more time in the case of a large size and irregularshape of a model-to-be-built, thus improving labor cost and reducing theefficiency of collision simulation.

When detecting whether model A (e.g. an iron ball) collides with model B(e.g. a wall), the computer device may use independent bricksconstituting the wall and the iron ball as a group of collisiondetection objects. For example, if the wall is composed of 100independent bricks, it means that there will be 100 groups of collisiondetection objects in this collision detection. In other words, thecomputer device needs to perform collision detection separately for eachgroup of collision detection objects, and the number of collisiondetections performed is equal to the number of independent bricks in thewall, which increases the computation amount of a Central ProcessingUnit (CPU) and a Graphics Processing Unit (GPU) of the computer device,thereby easily causing a phenomenon of picture blocking and reducing thefluency of collision simulation.

SUMMARY

According to some embodiments, a collision data processing method,performed by a computer device, may include: determining, based on aphysical engine detecting that a first rigid body having a firstphysical attribute collides with a second rigid body having a secondphysical attribute, an initial cutting model from a first modelcorresponding to the first rigid body and a second model correspondingto the second rigid body based on the first physical attribute and thesecond physical attribute; capturing, by the physical engine, acollision point between the first rigid body and the second rigid body,and determining normal vector information corresponding to the collisionpoint based on collision data associated with the collision point; anddetermining a first cutting surface in the initial cutting model basedon the collision point, the normal vector information, and modelinformation of the initial cutting model, and cutting the initialcutting model based on the first cutting surface to obtain cutting datafor presentation on a mobile terminal, the cutting data representing acollision effect between the first model and the second model.

According to various embodiments, a collision data processing apparatus,a computer device, a non-transitory computer-readable storage medium,and a computer program product or a computer program consistent with themethod may also be provided.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe the technical solutions of example embodiments of thisdisclosure more clearly, the following briefly introduces theaccompanying drawings for describing the example embodiments. Theaccompanying drawings in the following description show only someembodiments of the disclosure, and a person of ordinary skill in the artmay still derive other drawings from these accompanying drawings withoutcreative efforts. In addition, one of ordinary skill would understandthat aspects of example embodiments may be combined together orimplemented alone.

FIG. 1 is a schematic structural diagram of a network architectureaccording to some embodiments.

FIG. 2 is a schematic diagram of a scenario of data interactionaccording to some embodiments.

FIG. 3 is a schematic flowchart of a collision data processing methodaccording to some embodiments.

FIG. 4A is a schematic diagram of a scenario of binding a rigid body toan original model according to some embodiments.

FIG. 4B is a schematic diagram of a scenario of binding a rigid body toan original model according to some embodiments.

FIG. 5 is a schematic diagram of a scenario of determining a collisiongroup according to some embodiments.

FIG. 6 is a schematic diagram of a scenario of determining normal vectorinformation according to some embodiments.

FIG. 7 is a schematic diagram of a scenario of rotating a firstsurface-to-be-cut according to some embodiments.

FIG. 8 is a diagram comparing different cutting effects generated at thesame collision point according to some embodiments.

FIG. 9 is a schematic flowchart of a collision data processing methodaccording to some embodiments.

FIG. 10 is a flowchart of collision data processing according to someembodiments.

FIG. 11 is a schematic structural diagram of a collision data processingapparatus according to some embodiments.

FIG. 12 is a schematic diagram of a computer device according to someembodiments.

DESCRIPTION OF EMBODIMENTS

To make the objectives, technical solutions, and advantages of thepresent disclosure clearer, the following further describes the presentdisclosure in detail with reference to the accompanying drawings. Thedescribed embodiments are not to be construed as a limitation to thepresent disclosure. All other embodiments obtained by a person ofordinary skill in the art without creative efforts shall fall within theprotection scope of the present disclosure.

In the following descriptions, related “some embodiments” describe asubset of all embodiments. However, it may be understood that the “someembodiments” may be the same subset or different subsets of all theembodiments, and may be combined with each other without conflict.

In some embodiments, a physical engine introduced by a computer devicehaving a collision simulation function can acquire physical attributesof rigid bodies in real time. One rigid body corresponds to one originalmodel. When the physical engine detects that a first rigid body having afirst physical attribute collides with a second rigid body having asecond physical attribute, the computer device may determine an initialcutting model from a first model corresponding to the first rigid bodyand a second model corresponding to the second rigid body based on thefirst physical attribute and the second physical attribute, capture acollision point at which the first rigid body collides with the secondrigid body based on the physical engine, determine normal vectorinformation corresponding to the collision point based on collision dataassociated with the collision point, determine a first cutting surfacein the initial cutting model according to the collision point, thenormal vector information corresponding to the collision point, andmodel information of the initial cutting model, and then cut the initialcutting model based on the first cutting surface to obtain cutting datafor presentation on a mobile terminal. The cutting data may be used forsimulating a simulation effect of breaking the initial cutting modelinto fragments. The first model and the second model in some embodimentsare both independent original models, rather than models built bymultiple independent models. Therefore, in the process of collisionsimulation, the physical engine may directly perform collision detectionon the first rigid body bound to the first model and the second rigidbody bound to the second model, without performing multiple collisiondetections on the first model and the second model, whereby the numberof collision detections can be effectively reduced, thereby reducing thecomputation amount of the computer device and improving the fluency ofcollision simulation. Furthermore, manual participation in modelbuilding is not required in the creation process of the original models.Therefore, in the entire process of collision simulation, the labor costcan be reduced, and time consumed for model building can also be saved,so as to improve the efficiency of collision simulation.

FIG. 1 is a schematic structural diagram of a network architectureaccording to some embodiments. As shown in FIG. 1 , the networkarchitecture may include a server 10 and a user terminal cluster. Theuser terminal cluster may include one or more user terminals, and thenumber of user terminals is not limited herein. As shown in FIG. 1 ,user terminal 100 a, user terminal 100 b, user terminal 100 c . . . anduser terminal 100 n may be specifically included. User terminal 100 a,user terminal 100 b, user terminal 100 c . . . and user terminal 100 nmay be connected to the server 10 over a network respectively, wherebyeach user terminal may perform data interaction with the server 10through the network connection. The connection manner is not limited forthe network connection herein, and the network connection may be director indirect connection in a wired communication manner, may be direct orindirect connection in a wireless communication manner, and may also beother manners. This is not limited herein.

The user terminals in the user terminal cluster may, for example,include: smart terminals such as smart phones, tablet computers,notebook computers, desktop computers, wearable devices, smart homes,and head-mounted devices. It is to be understood that a model creationengine may be operated on a browser platform of each user terminal inthe user terminal cluster shown in FIG. 1 . The model creation engineherein is a multidimensional engine (such as a two-dimensional engine ora three-dimensional engine) for creating an original model. The modelcreation engine herein may be, for example, a Threejs engine. TheThreejs engine is a three-dimensional engine (also referred to as a 3Dengine) operated in a browser. A computer device (for example, theserver 10 shown in FIG. 1 ) having a collision simulation function insome embodiments may create various three-dimensional scenarios in adistributed graphical information system (World Wide Web, referred to asWeb for short) through the Threejs engine. The Threejs engine is aneasy-to-use 3D graphics library formed by encapsulating and simplifyinga Web Graphics Library (WebGL) interface, which includes various objectssuch as a camera, a shadow, and a material.

The original model created by the model creation engine may be a virtualobject associated with a target application (i.e. an application client)in the user terminal. The application client herein may include socialclients, multimedia clients (e.g. video clients), entertainment clients(e.g. game clients), educational clients, live clients, etc. Theapplication client may be an independent client, or may be an embeddedsub-client (e.g. an applet, etc.) integrated into a client (e.g. asocial client, an educational client, a multimedia client, etc.). Thisis not limited herein. For example, in a game scene, the original modelmay be a virtual object (e.g. a virtual gun, a virtual iron ball, avirtual wall, etc.) in a virtual game corresponding to a game client. Insome embodiments, the original model created by the model creationengine may also be a simulation model corresponding to a real object inthe real world. For example, the original model may be an involvedvehicle for simulating a car accident scene in order to assist a trafficpoliceman in restoring a traffic accident. Furthermore, the originalmodel may also be a model in other scenarios. This is not limitedherein.

As shown in FIG. 1 , the server 10 in some embodiments may be a servercorresponding to the browser platform. The server 10 may be anindependent physical server, or may be a server cluster including aplurality of physical servers or a distributed system, or may be a cloudserver providing basic cloud computing services, such as a cloudservice, a cloud database, cloud computing, a cloud function, cloudstorage, a network service, cloud communication, a middleware service, adomain name service, a security service, a content delivery network(CDN), big data an artificial intelligence platform.

For ease of understanding, in some embodiments, one user terminal may beselected from the plurality of user terminals shown in FIG. 1 as atarget user terminal configured to display cutting data. The cuttingdata herein may be an animation file generated by a computer device inthe process of collision simulation based on a physical engine. Forexample, in some embodiments, the user terminal 100 a shown in FIG. 1may be taken as a target user terminal.

The physical engine in some embodiments can bind a rigid body to anoriginal model created by a model creation engine, and then may assign aphysical attribute of the rigid body acquired in real time to thecorresponding original model, so as to control the original model toexecute a corresponding physical motion. The rigid body herein refers toan object with a constant shape and size, and constant relativepositions of internal points after motion and stress. It is to beunderstood that an absolutely rigid body does not actually exist and isonly an ideal model. The rigid body is often used in the physical engineto reduce the computation amount when simulating physical attributes ofobjects. It is to be understood that the physical engine may computemotion, rotation and collision reflections by way of assigning realphysical attributes to objects.

When the physical engine detects that a first rigid body having a firstphysical attribute collides with a second rigid body having a secondphysical attribute, it is necessary to determine an initial cuttingmodel from a first model corresponding to the first rigid body and asecond model corresponding to the second rigid body, determine acollision point at which the first rigid body collides with the secondrigid body, and normal vector information corresponding to the collisionpoint based on the physical engine, and determine a first cuttingsurface in the initial cutting model, so as to simulate a simulationeffect of breaking the initial cutting model into fragments. The firstmodel and the second model in some embodiments are complete andindependent original models, rather than models built by other smallindependent models. Therefore, in the process of collision simulation,there is no need for a user to participate in the process of modelbuilding, so that the labor cost is reduced, and time consumed for modelbuilding is also saved, so as to improve the efficiency of collisionsimulation. Furthermore, the first model and the second model areindependent original models, and one original model corresponds to onerigid body. Therefore, when the physical engine detects that the firstmodel collides with the second model, a computer device may performcollision detection only on the first rigid body bound to the firstmodel and the second rigid body bound to the second model, withoutperforming multiple collision detections on the same model, whereby thenumber of collision detections can be effectively reduced, therebyreducing the computation amount of the computer device and improving thefluency of collision simulation.

FIG. 2 is a schematic diagram of a scenario of data interactionaccording to some embodiments. As shown in FIG. 2 , a computer device insome embodiments may achieve a simulation effect of breaking a modelinto fragments through a physical engine. The entire process may bespecifically divided into three stages: model scenario, collisiondetection, and physical simulation. The computer device may be theserver 10 shown in FIG. 1 .

In the stage of model scenario, the computer device may start a modelcreation engine (e.g. a Threejs engine) associated with a browserplatform, and may create an original model that requires collisionsimulation, based on the model creation engine. The original model mayinclude original model a, original model b . . . and original model n.As shown in FIG. 2 , original model a in an animation image frame 2100may be a virtual iron ball in a game, original model b may be a virtualbuilding (e.g. a wall) in the game, and original model c may be anothervirtual building in the game, without enumeration herein. Further, sincethe physical engine needs to perform physical simulation on a rigid bodyand the original model created by the model creation engine does nothave a rigid body bound by default, the computer device needs to bind arigid body to an original model based on the physical engine, and oneoriginal model corresponds to one rigid body. For example, the computerdevice may bind, based on the physical engine, rigid body 20 A tooriginal model a as shown in FIG. 2 , bind rigid body 20 B to originalmodel b as shown in FIG. 2 , and so on.

The physical engine may refresh a physical attribute of a rigid body ineach frame of picture in the browser platform, and then may assign theacquired physical attribute of the rigid body to the original modelbound thereto, so as to control the original model to perform a physicalmotion in the browser platform, thereby detecting whether there are tworigid bodies in collision based on the physical attribute of each rigidbody. The physical attribute herein may include attribute informationsuch as position information, linear velocity, angular velocity,rotation angle, friction coefficient, momentum, and impulse of a rigidbody. The impulse is a physical quantity that represents an accumulationeffect on particles for a period of time, and is the reason to changethe mechanical motion state of particles.

In the stage of collision detection, in the animation image frame 2100,the computer device may detect that rigid body 20 A has collided withrigid body 20 B based on a physical attribute (i.e. a first physicalattribute) of rigid body 20 A and a physical attribute (i.e. a secondphysical attribute) of rigid body 20 B. At this moment, the computerdevice may determine an initial cutting model (e.g. original model b)from original model a and original model b based on the physicalattribute of rigid body 20 A and the physical attribute of rigid body 20B. The initial cutting model herein may be determined based on densityinformation of original model a and density information of originalmodel b.

In the stage of physical simulation, in the initial cutting model, thecomputer device may capture a collision point (e.g. coordinate point O1shown in FIG. 2 ) between rigid body 20 A and rigid body 20 B throughthe physical engine, and may then determine normal vector informationcorresponding to the collision point based on collision data associatedwith the collision point. The normal vector information herein mayinclude a normal vector length and a normal vector direction of a normalvector associated with the collision point. The normal vector length(e.g. a length between coordinate point O1 and coordinate point O3 shownin FIG. 2 ) may be determined based on a collision impulse generatedwhen rigid body A collides with rigid body B. The normal vectordirection (e.g. a direction in which coordinate point O1 points tocoordinate point O3 shown in FIG. 2 ) is an impulse direction of thecollision impulse.

At this moment, the computer device may acquire model information of theinitial cutting model. The model information herein may include a modelsize of the initial cutting model, model shape information (e.g. cube),and a geometric material. As shown in FIG. 2 , the model shapeinformation of the initial cutting model may include vertex information(e.g. eight vertices: vertex A1, vertex B1, vertex C1, vertex D1, vertexA, vertex B, vertex C, and vertex D), and central point information(e.g. central point O2) of the initial cutting model. Further, thecomputer device may determine a first cutting surface as shown in FIG. 2in the initial cutting model based on the collision point, the normalvector information, and the model information of the initial cuttingmodel. Cutting point m1, cutting point m2, cutting point m3, cuttingpoint m4, cutting point m5, and cutting point m6 in the initial cuttingmodel are intersection points between the first cutting surface and acontour line of the initial cutting model. Further, the computer devicemay cut the initial cutting model based on the first cutting surface.

Furthermore, the computer device may also acquire a cutting endcondition associated with the physical engine. The cutting end conditionherein may mean that a model size of the cut model is less than or equalto a model size threshold. The cutting end condition may also mean thatthe number of cuts recorded in this process of collision simulationreaches a number-of-cuts threshold. If the cut model does not satisfythe cutting end condition, the computer device may take the modelobtained by cutting the initial cutting model as a target cutting model,and then re-cut the target cutting model until the cut model satisfiesthe cutting end condition. If the cut model satisfies the cutting endcondition, the computer device may take the model satisfying the cuttingend condition as a target model. As shown in FIG. 2 , a target model inan animation image frame 2200 may be a model satisfying a cutting endcondition obtained by the computer device cutting original model b.

Further, the computer device may bind a target rigid body to the targetmodel through the physical engine, may also determine a linear velocityand an angular velocity of the target rigid body according to an impulseso as to acquire a physical attribute of the target rigid body, and maythen control the target model to collapse under gravity simulation basedon the physical attribute of the target rigid body being assigned to thetarget model so as to obtain cutting data for presentation on a mobileterminal (any one user terminal in the user terminal cluster shown inFIG. 1 , such as user terminal 100 a). The cutting data is obtainedbased on the animation image frame 2100, the animation image frame 2200,an animation image frame 2300, and an animation image frame 2400 shownin FIG. 2 , and the animation image frame 2300 and the animation imageframe 2400 may be animation image frames at two different times acquiredby the computer device under gravity simulation.

The physical engine in some embodiments may bind a rigid body to eachoriginal model, and one original model corresponds to one rigid body.Since original model a and original model b are independent originalmodels, rather than models built by multiple independent models, thecomputer device does not need to perform multiple collision detectionson original model a and original model b, whereby the number ofcollision detections can be effectively reduced, thereby reducing thecomputation amount of the computer device and improving the fluency ofcollision simulation. Manual participation in model building fororiginal model a and original model b is not required in someembodiments. Therefore, in the entire process of collision simulation,the labor cost can be reduced, and time consumed for model building canalso be saved, so as to improve the efficiency of collision simulation.

When the physical engine detects that a first rigid body collides with asecond rigid body, a computer device having a collision simulationfunction may cut an initial cutting model determined from a first modelcorresponding to the first rigid body and a second model correspondingto the second rigid body using the automatic process of the physicalengine and a program. The specific implementation may be seen from thefollowing embodiments corresponding to FIGS. 3-10 .

FIG. 3 is a schematic flowchart of a collision data processing methodaccording to some embodiments. As shown in FIG. 3 , the method may beperformed by a computer device having a collision simulation function.The computer device may be a user terminal (e.g. user terminal 100 ashown in FIG. 1 ) or a server (e.g. the server 10 shown in FIG. 1 ).This is not limited herein. For convenience of understanding, someembodiments are illustrated with an example where the method isperformed by a server. The method may include at least the followingoperations S101-S103:

Operation S101: Determine, in response to a physical engine detectingthat a first rigid body having a first physical attribute collides witha second rigid body having a second physical attribute, an initialcutting model from a first model corresponding to the first rigid bodyand a second model corresponding to the second rigid body based on thefirst physical attribute and the second physical attribute.

Specifically, a physical engine may be introduced by a computer devicehaving a collision simulation function so as to acquire physicalattributes of rigid bodies bound to original models in real time,thereby detecting whether there are two rigid bodies in collision. Inresponse to the physical engine detecting that a first rigid body havinga first physical attribute collides with a second rigid body having asecond physical attribute, the computer device may determine an initialcutting model from a first model corresponding to the first rigid bodyand a second model corresponding to the second rigid body based on thefirst physical attribute and the second physical attribute. The initialcutting model may be determined based on density information of themodel, and the density information may be obtained according to aphysical attribute of a corresponding rigid body.

For example, the computer device may determine density information ofthe first model corresponding to the first rigid body from the firstphysical attribute and determine density information of the second modelcorresponding to the second rigid body from the second physicalattribute. Further, the computer device may determine a model havingless density information from the first model and the second model basedon the two pieces of density information, and may then take the model asthe initial cutting model.

In some embodiments, the initial cutting model may also be preset by adevelopment user. For example, the development user may preset that whena virtual bullet in a game is fired to a virtual wall (i.e. the virtualbullet collides with the virtual wall), the virtual wall is broken. Atthis moment, the computer device may directly take a broken object (i.e.virtual wall), which is set by the development user, as the initialcutting model. The initial cutting model may also be determined in otherforms, and the determination manner is not limited herein.

The process of collision simulation in some embodiments may includethree stages: model scenario, collision detection, and physicalsimulation. It is to be understood that the computer device may createsome original models in a model scenario (e.g. a 3D scenario) associatedwith a browser platform. None of the original models herein are stackedfrom multiple small independent blocks, but are independent modelscreated by a model creation engine. For example, the original modelherein may be a standard geometry created by 3D production software. Itis not necessary to manually participate in the model building processof such an original model, whereby 3D technicians may be freed from theheavy work of model fragment combination, which not only saves the laborcost, but also saves the time consumed for model building, therebyimproving the efficiency of collision simulation.

Further, the computer device may quickly access a physical enginethrough several lines of code, so as to achieve a simulation effect ofbreaking the original model. The physical engine simulates rigid bodybehaviors by using object attributes (momentum, torque, elasticity,etc.), which not only achieves a more realistic simulation effect, butalso is easier for the development user to master than writing behaviorscripts. For example, the physical engine in some embodiments may be anAmmo.js physical engine. The Ammo.js physical engine may assist indealing with collisions between original models and simulating physicalphenomena such as gravity effects.

A Bullet Physics physical simulation engine is an open source physicalmodel engine which can be widely used in game development and movieproduction. In order to use the Bullet Physics physical simulationengine in a browser platform, according to some embodiments, the BulletPhysics physical simulation engine may be transplanted to a JavaScriptlanguage through the Ammo.js physical engine so as to use the functionsof the Bullet Physics physical simulation engine in the browser platformof a mobile terminal through the JavaScript language. The Bullet Physicsphysical simulation engine herein can use a GPU to complete physicalsimulation computation, the GPU has parallel computing andfloating-point computing capabilities that cannot be matched by a CPU,while the complex physical simulation computation relies on the parallelcomputing and floating-point computing capabilities.

Pseudo-code (e.g. pseudo-code 1) with which the computer deviceintroduces a physical engine may be as follows:

 “//default collision configuration information varcollisionConfiguration = new Ammo.btDefaultCollisionConfiguration();  //default collision dispatcher  vardispatcher = newAmmo.btCollisionDispatcher(collisionConfiguration);  //rigid bodycollision information, where rigid body pairs that may collide with eachother may be screened within a short time  broadphase = newAmmo.btDbvtBroadphase( );  //constraint solver  solver = newAmmo.btSequentialImpulseConstraintSolver( );  //physics world in whichall rigid bodies are physically simulated  physicsWorld= newAmmo.btDiscreteDvnamicsWorld(dispatcher,broadphase,solver,collisionConfiguration);  //set a weight value for a physicsworld  physicsWorld.setGravity(new Ammo.btVector3(0,−9.8,0));”

In pseudo-code 1, collision configuration information may be used forconfiguring information such as high-speed collision detection, stackallocators, and pool memory allocators. The computer device in someembodiments may invoke a collision dispatcher, whereby a constraintsolver can screen rigid body pairs (i.e. candidate contact pairs) whichmay collide with each other within a short time based on rigid bodycollision information.

A physical engine is a physical simulation of a rigid body. In otherwords, the physical engine acts on the rigid body rather than directlyon an original model. Since an original model created by a modelcreation engine in 3D software does not have a rigid body bound bydefault, the rigid body needs to be bound to the original model first inthe process of achieving a model breaking effect through the physicalengine. It is to be understood that rigid bodies may be set visually invarious mainstream 3D software (e.g. Unity or Unreal, etc.), and mayalso be added through a program code, and the rigid bodies are invisibleby default during project running.

The rigid body information for creating the rigid body may include rigidbody shape information, rigid body mass information, rigid body behaviorinformation, and rigid body inertia information. The original model isan independent model, thereby reducing the number of collisiondetections. Therefore, the computation amount of the computer device issmall, and in order to improve the collision accuracy, the rigid bodyshape information may be closer to the model shape information. In someembodiments, in order to simplify computation during collision, therigid body shape information may be a standard geometry including amodel. In other words, the rigid body shape information may be differentfrom the model shape information.

For example, the computer device may start a model creation engineassociated with a browser platform, and may then create N originalmodels for a game corresponding to a game client through the modelcreation engine. N is a positive integer greater than or equal to 2. TheN original models may include the first model and the second model. Thecomputer device may determine first model information of the first modelbased on the physical engine, and may then determine first rigid bodyinformation of the first rigid body including the first model accordingto the first model information. Further, the computer device may createthe first rigid body to be bound with the first model based on the firstrigid body information, and bind the first rigid body with a firstvariable parameter in the first model. The first variable parameter maybe used for instructing the physical engine to determine the first rigidbody corresponding to the first model. Similarly, the computer devicemay determine second model information of the second model based on thephysical engine, and may then determine second rigid body information ofthe second rigid body including the second model according to the secondmodel information. Further, the computer device may create the secondrigid body to be bound with the second model based on the second rigidbody information, and bind the second rigid body with a second variableparameter in the second model. The second variable parameter may be usedfor instructing the physical engine to determine the second rigid bodycorresponding to the second model.

For example, pseudo-code (e.g. pseudo-code 2) with which the computerdevice binds a rigid body to an original model (e.g. a 3D sphere)through the physical engine may be as follows:

“//create a 3D sphere through Threejs var ball =new THREE.Mesh(newTHREE.SphereBufferGeometry(ballRadius, 14,10),ballMaterial); //create aspherical rigid body shape through Ammo.js varballshape = newAmmo.btSphereShape(ballRadius); //rigid body information, where mass isrigid body mass information, motionState is rigid body behaviorinformation, ballshape is rigid body shape information, and localInertiais rigid body inertia information; varrbInfo= newAmmo.btRigidBodvConstructionInfo(mass,motionState,ball-shape,localInertia);//create a rigid body using rigid body information var body = newAmmo.btRigidBody(rbInfo); //bind rigid bodies to a userData.physicsBodyvariable of a 3D model, through which rigid bodies bound to the modelmay subsequently be acquired ball.userData.physicsBody =body;”

It is to be understood that rigid mass information and rigid shapeinformation are two more important attributes. As a value indicated bythe rigid body mass information is greater, energy required to changethe motion state of the rigid body is higher, and the rigid body shapeinformation determines a collision detection range from a rigid body toa rigid body.

FIG. 4A is a schematic diagram of a scenario of binding a rigid body toan original model according to some embodiments. As shown in FIG. 4A,original model a may be an original model created for a game (e.g. a gungame) by a computer device starting a model creation engine associatedwith a browser platform. For example, original model a may be a gamefighter controllable by a game user corresponding to the game.

The premise that a physical engine can act on original model a is tobind a rigid body to original model a. Specifically, a computer devicehaving a collision simulation function may determine model informationof original model a based on the physical engine. The model informationof original model a may include a model size of original model a, modelshape information of original model a, and a geometric material oforiginal model a. Further, the computer device may create rigid bodyshape information attached to the model information of original model aaccording to the model information of original model a. In order toreduce the computation amount for subsequent collision detection, thecomputer device may also select shape information capable of including astandard geometry of original model a as the rigid body shapeinformation of the bound rigid body. Furthermore, the computer devicemay also acquire rigid body mass information, rigid body behaviorinformation, and rigid body inertia information set by a developmentuser, and may then obtain rigid body information of a rigid body boundwith original model a based on these information. Further, the computerdevice may create a rigid body (e.g. rigid body 400 A shown in FIG. 4A)to be bound with original model a based on the determined rigid bodyinformation, and may then bind rigid body 400 A with a variableparameter in original model a. The variable parameter in original modela may be used for instructing the physical engine to determine rigidbody 400 A corresponding to original model a.

After rigid body 400 A is successfully bound to original model a, aspace coordinate system may be established in original model a with acentral point of original model a as a coordinate origin. Rigid body 400A bound to original model a may be set visually in various mainstream 3Dsoftware, and may also be added through a program code, and rigid body400 A and the space coordinate system in rigid body 400 A are invisibleby default during project running.

FIG. 4B is a schematic diagram of a scenario of binding a rigid body toan original model according to some embodiments. As shown in FIG. 4B,original model b may be another original model created for a game (e.g.a gun game) by a computer device starting a model creation engineassociated with a browser platform. For example, original model b may bean enemy fighter in the game.

The computer device needs to bind a rigid body to original model b basedon a physical engine to control original model b to perform a physicalmotion. Specifically, a computer device having a collision simulationfunction may determine model information of original model b based onthe physical engine. The model information of original model b mayinclude a model size of original model b, model shape information oforiginal model b, and a geometric material of original model b. Further,the computer device may create rigid body shape information of a rigidbody to be bound to original model b according to the model informationof original model b.

In order to reduce the computation amount for subsequent collisiondetection, the computer device may select shape information capable ofincluding a geometry of original model b as the rigid body shapeinformation of the rigid body to be bound (e.g. rigid body shapeinformation 1), and may then obtain rigid body information includingrigid body shape information 1. At this moment, the computer device maycreate a rigid body (e.g. rigid body 410B shown in FIG. 4B) to be boundwith original model b based on the rigid body information includingrigid body shape information 1, and may then bind rigid body 410B with avariable parameter in original model b.

In order to improve the accuracy of subsequent collision detection, thecomputer device may also take model shape information closer to originalmodel b as the rigid body shape information of the rigid body to bebound (e.g. rigid body shape information 2), and may then obtain rigidbody information including rigid body shape information 2. At thismoment, the computer device may create a rigid body (e.g. rigid body 420B shown in FIG. 4B) to be bound with original model b based on the rigidbody information including rigid body shape information 2, and may thenbind rigid body 420 B with a variable parameter in original model b.

The physical engine in the computer device in some embodiments may bindrigid bodies to each original model requiring physical simulation (i.e.collision simulation) according to a rigid body binding method shown inpseudo-code 2, and may then automatically process physical attributes ofeach rigid body. The physical attribute herein may include attributeinformation such as position information, linear velocity, angularvelocity, rotation angle, friction coefficient, momentum, and impulse.The impulse may be a physical quantity that represents an accumulationeffect on particles for a period of time, and is the reason to changethe mechanical motion state of particles.

The computer device may refresh a physical attribute of a rigid body ineach animation image frame in the browser platform through the physicalengine, and may then assign the physical attribute of the rigid body toan original model bound therewith, whereby the original model performs aphysical motion according to a motion mode of the rigid body. Oneoriginal model corresponds to one rigid body.

Furthermore, the computer device may also perform collision detection onthe N rigid bodies corresponding to the N original models based on thephysical engine. That is, the computer device may acquire physicalattributes of N rigid bodies corresponding to N original models based onthe physical engine, acquire a reference collision rigid body from the Nrigid bodies, and take rigid bodies other than the reference collisionrigid body in the N rigid bodies as candidate collision rigid bodies.Further, the computer device may determine a collision region associatedwith the reference collision rigid body based on a physical attribute ofthe reference collision rigid body and a collision distance threshold(e.g. 3 cm) corresponding to the physical engine. In other words, thecomputer device may take a region within 3 cm from the referencecollision rigid body as a collision region associated with the referencecollision rigid body based on position information of the referencecollision rigid body.

In the presence of a candidate collision rigid body, falling into thecollision region, among the candidate collision rigid bodies, thecomputer device may determine the candidate collision rigid body fallinginto the collision region as a target collision rigid body, and may thenform candidate contact pairs by the target collision rigid body and thereference collision rigid body. Further, the computer device may acquirea collision detection condition, perform collision detection on thecandidate contact pairs based on the collision detection condition,screen a candidate contact pair satisfying the collision detectioncondition from the respective candidate contact pairs, and take thescreened candidate contact pair as a collision group. The referencecollision rigid body in the collision group may be referred to as thefirst rigid body in some embodiments. The target collision rigid body inthe collision group may be referred to as the second rigid body.

The computer device may perform collision detection on the targetcollision rigid body and the reference collision rigid body in thecandidate contact pairs based on a physical attribute of the targetcollision rigid body in the candidate contact pairs and the physicalattribute of the reference collision rigid body in the candidate contactpairs. In specific implementations, using a ray-based collisiondetection method, the computer device may determine a first predictedcontact point in the target collision rigid body, determine a secondpredicted contact point corresponding to the first predicted contactpoint in the reference collision rigid body, and determine a predicteddistance between the first predicted contact point and the secondpredicted contact point through the physical engine.

Further, the computer device may acquire a collision detectioncondition. The collision detection condition may be used for screeningcandidate contact pairs having non-positive predicted distances. Inother words, if the predicted distance between the first predictedcontact point and the second predicted contact point is less than orequal to zero, the computer device may take the candidate contact pairsto which the target collision rigid body and the reference collisionrigid body belong as a candidate contact pair satisfying the collisiondetection condition. If the predicted distance between the firstpredicted contact point and the second predicted contact point isgreater than zero, the computer device may take the candidate contactpairs to which the target collision rigid body and the referencecollision rigid body belong as a candidate contact pair not satisfyingthe collision detection condition. The computer device may screen thecandidate contact pair satisfying the collision detection condition as acollision group from the respective candidate contact pairs.

FIG. 5 is a schematic diagram of a scenario of determining a collisiongroup according to some embodiments. As shown in FIG. 5 , a computerdevice in some embodiments may bind a rigid body to each original modelrequiring physical simulation (i.e. collision simulation), and oneoriginal model corresponds to one rigid body. In order to explain thedetermination process of a collision group, the computer device mayacquire, in an example where the total number of original models is 6,physical attributes of six rigid bodies corresponding to the sixoriginal models based on a physical engine below. The six rigid bodiesmay specifically include rigid body A, rigid body B1, rigid body B2,rigid body B3, rigid body B4, and rigid body B5.

The reference collision rigid body determined by the computer device maybe any one of the six rigid bodies. For example, if rigid body A shownin FIG. 5 is a virtual object controlled by a game user in a certaingame, for example, a game bullet. At this moment, the computer devicemay take rigid body A as a reference collision rigid body, and may thentake rigid bodies other than rigid body A in the six rigid bodies ascandidate collision rigid bodies. For example, rigid body B1, rigid bodyB2, rigid body B3, rigid body B4, and rigid body B5 are all taken ascandidate collision rigid bodies.

The computer device may determine position information of rigid body Afrom a physical attribute of rigid body A, and may then determine acollision region (e.g. collision region 50 q shown in FIG. 5 )associated with rigid body A based on position information of rigid bodyA and a collision distance threshold (e.g. 3 cm) corresponding to thephysical engine.

Further, the computer device may detect collision region 50 q. In thepresence of a candidate collision rigid body, falling into collisionregion 50 q, among the candidate collision rigid bodies, the computerdevice may determine the candidate collision rigid body falling intocollision region 50 q as a target collision rigid body, and may thentake the target collision rigid body and the reference collision rigidbody as candidate contact pairs. As shown in FIG. 5 , there are rigidbodies B1, B3, and B4 in collision region 50 q. At this moment, thecomputer device may take these three rigid bodies as target collisionrigid bodies, and may then determine candidate contact pairs associatedwith rigid body A. Candidate contact pairs determined by the computerdevice may include contact pair 1, contact pair 2, and contact pair 3.Contact pair 1 may be composed of rigid body A and rigid body B1.Contact pair 2 may be composed of rigid body A and rigid body B3.Contact pair 3 may be composed of rigid body A and rigid body B4.

Further, the computer device may predict a predicted contact point ineach contact pair based on physical attributes of the two rigid bodiesin each contact pair using a ray-based collision detection method. Forexample, the computer device may predict a possible contact point (i.e.a predicted contact point) when the two rigid bodies in the contact paircollide based on the linear velocity, position information, angularvelocity, rotation angle, etc. of the two rigid bodies, and may thendetermine whether the two rigid bodies intersect based on the acquiredcollision detection condition, so as to screen candidate contact pairswhich may collide.

For contact pair 1, the computer device may determine that a predicteddistance between a first predicted contact point in rigid body A (e.g.predicted contact point 1 shown in FIG. 5 ) and a second predictedcontact point in rigid body B1 (e.g. predicted contact point 1′ shown inFIG. 5 ) is greater than 0. At this moment, the computer device maydetermine contact pair 1 as a candidate contact pair not satisfying thecollision detection condition, i.e. the two rigid bodies in contact pair1 do not collide. Similarly, for contact pair 2, the computer device maydetermine that a predicted distance between a first predicted contactpoint in rigid body A (e.g. predicted contact point 2 shown in FIG. 5 )and a second predicted contact point in rigid body B3 (e.g. predictedcontact point T shown in FIG. 5 ) is greater than 0. At this moment, thecomputer device may determine contact pair 2 as a candidate contact pairnot satisfying the collision detection condition. Similarly, for contactpair 3, the computer device may determine that a predicted distancebetween a first predicted contact point in rigid body A (e.g. predictedcontact point 3 shown in FIG. 5 ) and a second predicted contact pointin rigid body B4 (e.g. predicted contact point 3′ shown in FIG. 5 ) isequal to 0. At this moment, the computer device may determine contactpair 3 as a candidate contact pair satisfying the collision detectioncondition. In other words, rigid body A and rigid body B4 may collide,i.e. contact pair 3 is a collision group. At this moment, the computerdevice may take rigid body A in contact pair 3 as a first rigid body andrigid body B4 in contact pair 3 as a second rigid body.

Further, the computer device may determine an initial cutting model froman original model (i.e. a first model) corresponding to rigid body A andan original model (i.e. a second model) corresponding to rigid body B4based on a first physical attribute of rigid body A and a secondphysical attribute of rigid body B4. For example, if the first physicalattribute indicates that density information of the original modelcorresponding to rigid body A is density information 1, the secondphysical attribute indicates that density information of the originalmodel corresponding to rigid body B4 is density information 2, anddensity information 1 is less than density information 2, the computerdevice may take the original model corresponding to rigid body A as theinitial cutting model.

It is to be understood that each of the six rigid bodies shown in FIG. 5may be regarded as a reference collision rigid body. For example, whenrigid body B1 is taken as a reference collision rigid body, the computerdevice may determine a target collision rigid body from candidatecollision rigid bodies (e.g. rigid body A, rigid body B2, rigid body B3,rigid body B4, and rigid body B5) based on a collision region associatedwith rigid body B1 so as to form candidate contact pairs, and may thenscreen a collision group satisfying the collision detection condition,and details are not described herein again.

Operation S102: Capture, by the physical engine, a collision pointbetween the first rigid body and the second rigid body, and determinenormal vector information corresponding to the collision point based oncollision data associated with the collision point.

Specifically, the computer device may capture, by the physical engine, acollision point at which the first rigid body collides with the secondrigid body in a model coordinate system (i.e. a world coordinate systemof a physics world where collision simulation is located) where theinitial cutting model is located. Further, the computer device may alsoacquire, by the physical engine, a collision impulse generated inresponse to the first rigid body colliding with the second rigid body,and an impulse direction of the collision impulse, determine a normalvector length of a normal vector associated with the collision pointaccording to the collision impulse, and determine a normal vectordirection of the normal vector according to the impulse direction. Atthis moment, the computer device may determine normal vector informationcorresponding to the collision point based on the normal vectordirection and the normal vector length.

Pseudo-code (e.g. pseudo-code 3) with which the computer device performscollision detection and determines a collision point and normal vectorinformation may be as follows:

 “for (vari=0,il=dispatcher.getNumManifolds( );i<il;i++)  {  varcontactManifold =dispatcher.getManifoldByIndexInternal(i);//acquire each candidatecontact pair from a collision dispatcher   for(varj=0,jl=contactManifold.getNumContacts( );j<jl;j++)   {   varcontactPoint= contactManifold.getContactPoint(j);//acquire each predicted contactpoint from candidate contact pairs   if (contactPoint. getDistance()≤0)//if two rigid bodies intersect, determine that collision (impact)occurs    {   var impulse = contactPoint.getAppliedImpulse();//collision impulse   varpos = contactPoint.get_m_positionWorld0nB();//coordinates of collision point   var normal =contactPoint.get_m_normalWorld0nB( );//normal vector    }   }  }”

The physical engine in some embodiments may return information of allpossible colliding rigid body pairs in the form of candidate contactpairs (collision groups, i.e. contactManifold). According to the contentshown in pseudo-code 3: the computer device may invoke a collisiondispatcher to acquire each detected candidate contact pair, and may thendetermine whether two rigid bodies in each candidate contact pairintersect based on the collision detection condition. Rigid bodyintersection means that the distance between corresponding predictedcontact points on two rigid bodies in a candidate contact pair is lessthan or equal to zero. i1 may represent the total number of candidatecontact pairs determined by the computer device, and j1 may representthe total number of predicted contact points of a certain candidatecontact pair determined by the computer device. When the collision oftwo rigid bodies is detected, the computer device may determine acollision impulse when the two rigid bodies collide, and capturecoordinate information of a collision point, and then determine normalvector information corresponding to the collision point.

FIG. 6 is a schematic diagram of a scenario of determining normal vectorinformation according to some embodiments. As shown in FIG. 6 , rigidbody A and rigid body B in some embodiments may be candidate contactpairs acquired by a computer device through a collision dispatcher.Rigid body A and rigid body B are rigid bodies bound to two originalmodels created by the computer device for a model creation enginethrough a physical engine. One original model corresponds to one rigidbody.

The computer device may determine predicted contact point 6 (i.e. afirst predicted contact point) in rigid body A and predicted contactpoint 6′ (i.e. a second predicted contact point) corresponding topredicted contact point 6 in rigid body B through the physical engine,and may then determine a predicted distance between predicted contactpoint 6 and predicted contact point 6′. As shown in FIG. 6 , thepredicted distance between predicted contact point 6 and predictedcontact point 6′ is less than zero. At this moment, the computer devicemay determine that rigid body A and rigid body B are two rigid bodies incollision.

Further, the computer device may determine that an original modelcorresponding to rigid body B is an initial cutting model based on aphysical attribute of rigid body A and a physical attribute of rigidbody B. At this moment, the computer device may capture a collisionpoint (i.e. predicted contact point 6′ shown in FIG. 6 ) at which rigidbody A collides with rigid body B through the physical engine in a modelcoordinate system of the original model corresponding to rigid body B.Further, the computer device may acquire, by the physical engine, acollision impulse generated in response to rigid body A colliding withrigid body B, and an impulse direction of the collision impulse,determine a normal vector length of a normal vector associated withcollision point 6 shown in FIG. 6 according to the collision impulse,and determine a normal vector direction of the normal vector accordingto the impulse direction of the collision impulse. Further, the computerdevice may determine normal vector information (e.g. normal vectorinformation 6 f shown in FIG. 6 ) corresponding to the collision pointbased on the normal vector length and the normal vector direction.

Operation S103: Determine a first cutting surface in the initial cuttingmodel based on the collision point, the normal vector information, andmodel information of the initial cutting model, and cut the initialcutting model based on the first cutting surface to obtain cutting datafor presentation on a mobile terminal.

Specifically, the computer device may determine a space coordinatesystem with a central point of the initial cutting model as a coordinateorigin in a model coordinate system where the initial cutting model islocated, determine first central position information of the centralpoint of the initial cutting model in the space coordinate system basedon relative coordinate conversion information between the modelcoordinate system and the space coordinate system, and determinecollision position information of the collision point in the spacecoordinate system. Further, the computer device may determine a firstcutting surface in the initial cutting model based on the first centralposition information, the collision position information, and the normalvector information, and cut the initial cutting model based on the firstcutting surface to obtain cutting data for presentation on a mobileterminal. The cutting data may be used for representing a collisioneffect between the first model and the second model.

It is to be understood that the model coordinate system where theinitial cutting model is located may refer to a world coordinate systemof a physics world where the collision simulation is located. In thecutting process for the initial cutting model, the computer device mayestablish a space coordinate system with the central point of theinitial cutting model as an origin point in the initial cutting model soas to acquire coordinate position information of respective coordinatepoints in the initial cutting model. The origin of the space coordinatesystem may, certainly, be another coordinate point associated with theinitial cutting model, e.g. a certain vertex. The origin of the spacecoordinate system is not limited herein. Relative coordinate conversioninformation between the model coordinate system and the space coordinatesystem may be used for instructing the computer device to convertcoordinate position information of a certain coordinate point. Forexample, the central position information of the central point of theinitial cutting model in the model coordinate system may be (23000,59456, 20361), and the central position information of the central pointof the initial cutting model determined by the computer device based onthe relative coordinate conversion information may be (0, 0, 0) in thespace coordinate system. It can be seen therefrom that the conversion ofthe coordinate system may simplify the coordinate position informationof the coordinate points in the initial cutting model, and may thenfacilitate the subsequent determination of a surface-to-be-cut, so as toreduce the computational complexity of the computer device.

The normal vector information may include a normal vector length and anormal vector direction of a normal vector associated with the collisionpoint. The normal vector length is determined based on a collisionimpulse generated in response to the first rigid body colliding with thesecond rigid body. The normal vector direction may be an impulsedirection of the impact impulse.

In the process of determining a first cutting surface of the initialcutting model, the computer device may determine a central pointcorresponding to the first central position information as a firstauxiliary point (e.g. coordinate point O2 in the initial cutting modelshown in FIG. 2 ), determine the collision point corresponding to thecollision position information as a second auxiliary point (e.g.coordinate point O1 in the initial cutting model shown in FIG. 2 ), andtake, along the normal vector direction, a coordinate pointcorresponding to position information at a distance from the collisionposition information by the normal vector length as a third auxiliarypoint (e.g. coordinate point O3 in the initial cutting model shown inFIG. 2 ). Further, the computer device may determine a firstsurface-to-be-cut in the initial cutting model based on the firstauxiliary point, the second auxiliary point, and the third auxiliarypoint, and may then determine a first cutting surface based on the firstsurface-to-be-cut.

In some embodiments, the first surface-to-be-cut may be directly takenas the first cutting surface.

In some embodiments, in order not to make the same collision pointproduce the same cutting effect at each collision, the computer devicemay also randomly rotate the first surface-to-be-cut and take therandomly rotated first surface-to-be-cut as the first cutting surface.It is to be understood that the computer device may randomly select anangle as a first angle for rotating the first surface-to-be-cut withinan angle interval (e.g. [0, π]) associated with the physical engine,rotate the first surface-to-be-cut according to the first angle bytaking the normal vector as a rotation axis and taking the collisionpoint as a rotation point, and take the rotated first surface-to-be-cutas the first cutting surface.

FIG. 7 is a schematic diagram of a scenario of rotating a firstsurface-to-be-cut according to some embodiments. As shown in FIG. 7 , asurface-to-be-cut 700 in some embodiments may be a firstsurface-to-be-cut determined by a computer device in an initial cuttingmodel (e.g. a cylinder model). The computer device herein may be theserver 10 shown in FIG. 1 .

In some embodiments, the length of the surface-to-be-cut 700 may be aside height h of the cylinder model, and the width of thesurface-to-be-cut 700 may be a bottom radius r of the cylinder model. Inorder not to make the same collision point (e.g. collision point 7)produce the same cutting effect at each collision, the computer devicemay randomly rotate the surface-to-be-cut 700 shown in FIG. 7 and takethe randomly rotated surface-to-be-cut 700 as the first cutting surface.Coordinates x and y shown in FIG. 7 may be used for representingcollision position information of collision point 7 in a spacecoordinate system of the initial cutting model.

The computer device may randomly select an angle as an angle (e.g. π/2)for rotating the surface-to-be-cut 700 within an angle interval (e.g.[0, π]) associated with a physical engine. Further, the computer devicemay rotate the surface-to-be-cut 700 by π/2 according to a rotationdirection shown in FIG. 7 by taking a normal vector shown in FIG. 7 as arotation axis and collision point 7 as a rotation point, and may thentake the surface-to-be-cut 700 rotated by π/2 as a first cutting surfacefor cutting the cylinder model.

At this moment, the computer device may cut the initial cutting modelbased on the first cutting surface. Specifically, the computer devicemay acquire vertex position information of a vertex of the initialcutting model in the space coordinate system of the initial cuttingmodel based on model information of the initial cutting model, determinea contour line of the initial cutting model based on the vertex positioninformation, acquire an intersection point (i.e. a cutting point)between the contour line and the first cutting surface, and determinecutting position information of the cutting point in the spacecoordinate system.

The intersection points of the first cutting surface with the respectivesurfaces of the initial cutting model may be calculated using anintersectLine method of a Plane class of a model creation engine (e.g. aThreejs engine). Specifically, pseudo-code (e.g. pseudo-code 4) withwhich the computer device determines an intersection point between afirst cutting surface and a contour line may be as follows:

 “var plane = new THREE.Plane( );//cutting surface plane.setFromCoplanarPoints(a,b,c);//three points may determine oneplane, a is a first auxiliary point (e.g. a model central point), b is asecond auxiliary point (e.g. a collision point), and c is a thirdauxiliary point (e.g. a coordinate point corresponding to positioninformation at a distance from collision position information by anormal vector length along a normal vector direction)  var line = newTHREE.Line3( );//two vertices may determine one contour line line.start.copy(p0);//set a start point of a contour line line.end.copy(p1);//set an end point of a contour line  varintersection = new Vector3( );//intersection point (i.e. cutting point)between a contour line and a cutting surface  intersection =plane.intersectLine(line,intersection);//detect an intersection pointbetween a contour line and a plane, and write a result into anintersection parameter”

As shown in FIG. 2 , the initial cutting model may include eightvertices: vertex A1, vertex B1, vertex C1, vertex D1, vertex A, vertexB, vertex C, and vertex D. The cutting point between the contour lineand the first cutting surface, determined by the computer device, mayinclude cutting point m1, cutting point m2, cutting point m3, cuttingpoint m4, cutting point m5, and cutting point m6. Cutting point m1 maybe an intersection point between contour line C1D1 and the firstsurface-to-be-cut. Cutting point m2 may be an intersection point betweencontour line B1C1 and the first surface-to-be-cut. Cutting point m3 maybe an intersection point between contour line BB1 and the firstsurface-to-be-cut. Cutting point m4 may be an intersection point betweencontour line AB and the first surface-to-be-cut. Cutting point m5 may bean intersection point between contour line AD and the firstsurface-to-be-cut. Cutting point m6 may be an intersection point betweencontour line DD1 and the first surface-to-be-cut.

Further, the computer device may cut the initial cutting model into afirst cutting model and a second cutting model based on the cuttingposition information and the vertex position information, and obtaincutting data for presentation on the mobile terminal based on the firstcutting model and the second cutting model. The computer device maydetermine, by a model creation engine, a geometric material of theinitial cutting model from the model information of the initial cuttingmodel, and may then determine a first coordinate array for constructingthe first cutting model and a second coordinate array for constructingthe second cutting model based on the cutting position information andthe vertex position information.

As shown in FIG. 2 , the first coordinate array determined by thecomputer device may include cutting position information of cuttingpoint m1, cutting position information of cutting point m2, cuttingposition information of cutting point m3, cutting position informationof cutting point m4, cutting position information of cutting point m5,cutting position information of cutting point m6, vertex positioninformation of vertex A, vertex position information of vertex A1,vertex position information of vertex D1, and vertex positioninformation of vertex B1. The second coordinate array determined by thecomputer device may include cutting position information of cuttingpoint m1, cutting position information of cutting point m2, cuttingposition information of cutting point m3, cutting position informationof cutting point m4, cutting position information of cutting point m5,cutting position information of cutting point m6, vertex positioninformation of vertex B, vertex position information of vertex C, vertexposition information of vertex D, and vertex position information ofvertex C1.

Further, the computer device may create a first geometric structure ofthe first cutting model by using the first coordinate array, and createthe first cutting model based on the first geometric structure and thegeometric material. Similarly, the computer device may create a secondgeometric structure of the second cutting model by using the secondcoordinate array, and create the second cutting model based on thesecond geometric structure and the geometric material.

Specifically, the computer device may create a new cut model accordingto a group of coordinate arrays (e.g. the first coordinate array or thesecond coordinate array) by using an encapsulated ConvexGeometry of amodel creation engine (e.g. a Threejs engine). Specifically, pseudo-code(e.g. pseudo-code 5) with which the computer device determines a new cutmodel may be as follows:

 “//create a control geometric structure by using a coordinate array,where a parameter points is an array composed of multiple vertexcoordinates  vargeometry = new ConvexGeometry(points);  //geometrymaterial  var material = new THREE.MeshBasicMaterial({color: 0x00ff00}); //create a new model through a geometric structure and material  varmesh = new THREE.Mesh(geometry,material)”

Pseudo-code 5 may be used for cutting the initial cutting model into twonew models (i.e. the first cutting model and the second cutting model).Meanwhile, the computer device may remove the initial cutting model froma model scenario so as to complete the process of dividing the initialcutting model into two models.

Further, the computer device may determine the first cutting model andthe second cutting model as a target cutting model, acquire a cuttingend condition associated with the physical engine, and obtain cuttingdata for presentation on a mobile terminal in response to the targetcutting model satisfying the cutting end condition.

The cutting end condition may include a model size threshold. Based onthis, the computer device may acquire a model size of the target cuttingmodel. If the model size of the target cutting model is greater than themodel size threshold, the computer device may determine that the targetcutting model does not satisfy the cutting end condition. At thismoment, the computer device needs to continue cutting the target cuttingmodel. If the model size of the target cutting model is less than orequal to the model size threshold, the computer device may determinethat the target cutting model satisfies the cutting end condition.

In some embodiments, the cutting end condition may also include anumber-of-cuts threshold (e.g. 5). Based on this, the computer devicemay record the number of cuts that have been performed when obtainingthe target cutting model during the collision simulation of the initialcutting model. If the number of cuts does not reach the number-of-cutsthreshold, the computer device may determine that the target cuttingmodel does not satisfy the cutting end condition. At this moment, thecomputer device needs to continue cutting the target cutting model notsatisfying the cutting end condition. If the number of cuts reaches thenumber-of-cuts threshold, the computer device may determine that thetarget cutting model satisfies the cutting end condition.

The computer device may take the target cutting model satisfying thecutting end condition as a target model, and may then determine a targetrigid body corresponding to the target model based on the physicalengine and target model information of the target model. The specificimplementation of the computer device determining a target rigid bodycorresponding to the target model may be seen from the above specificimplementation of determining the first rigid body corresponding to thefirst model, and details are not described herein again.

Further, the computer device may acquire a physical attribute of thetarget rigid body, so as to control the target model to execute aphysical motion based on the physical attribute of the target rigidbody. Meanwhile, the computer device may acquire an animation imageframe during the execution of the physical motion, and may then obtainthe cutting data for presentation on the mobile terminal based on theanimation image frame. It is to be understood that when a certain gameuser performs a certain trigger operation (e.g. a screen slidingoperation) in a game so that a first model and a second model in thegame collide, the computer device may output cutting data correspondingto this trigger operation to a mobile terminal (e.g. any one of the userterminals in the user terminal cluster shown in FIG. 1 , e.g. userterminal 100 a) used by the game user, so that the mobile terminaldisplays a collision effect between the models based on the cuttingdata.

FIG. 8 is a diagram comparing different cutting effects generated at thesame collision point according to some embodiments. As shown in FIG. 8 ,original model a in some embodiments may be a first model correspondingto a first rigid body, and original model b may be a second modelcorresponding to a second rigid body. Original model a may be an ironball in a game, and original model b may be a hit building (e.g. apillar) in the game.

As shown in FIG. 8 , a physical engine in a computer device maydetermine original model b as an initial cutting model upon detectingthat the first rigid body bound to original model a collides with thesecond rigid body bound to original model b. In order to effectivelyensure the visual experience of a user, in the process of cuttingoriginal model b, a cutting surface in each cutting is obtained byrotating a surface-to-be-cut according to a random angle. Cutting effect1 shown in FIG. 8 may be a cutting effect obtained when the computerdevice detects that the first rigid body and the second rigid bodycollide at a certain collision point at time T1 (i.e. a first time), andcuts the initial cutting model. Cutting effect 2 shown in FIG. 8 may bea cutting effect obtained when the computer device detects that thefirst rigid body and the second rigid body collide at the same collisionpoint at time T2 (i.e. a second time), and cuts the initial cuttingmodel. The first time and the second time may refer to two differenttimes detected by the computer device when two rigid bodies collide atthe same collision point.

In some embodiments, the simulation effect of breaking an original modelon a mobile device such as a mobile phone may be simulated. A physicalengine introduced by a computer device having a collision simulationfunction can acquire physical attributes of rigid bodies in real time.One rigid body corresponds to one original model. The first model andthe second model in some embodiments are both independent originalmodels, rather than models built by multiple independent models.Therefore, in the process of collision simulation, the physical enginemay directly perform collision detection on the first rigid body boundto the first model and the second rigid body bound to the second model,without performing multiple collision detections on the first model andthe second model, whereby the number of collision detections can beeffectively reduced, thereby reducing the computation amount of thecomputer device and improving the fluency of collision simulation.Furthermore, manual participation in model building is not required inthe creation process of the original models, a design user is no longerresponsible for the related design work of model fragmentation, and thedifficulty of coding by a program development user is also reduced.Therefore, in the entire process of collision simulation, the labor costcan be reduced, and time consumed for model building can also be saved,so as to improve the efficiency of collision simulation.

FIG. 9 is a schematic flowchart of a collision data processing methodaccording to some embodiments. As shown in FIG. 9 , the method may beperformed by a computer device having a collision simulation function.The computer device may be a user terminal (e.g. user terminal 100 ashown in FIG. 1 ) or a server (e.g. the server 10 shown in FIG. 1 ).This is not limited herein. For convenience of understanding, someembodiments are illustrated with an example where the method isperformed by a server. The method may include at least the followingoperations S201-S207:

Operation S201: Determine, in response to a physical engine detectingthat a first rigid body having a first physical attribute collides witha second rigid body having a second physical attribute, an initialcutting model from a first model corresponding to the first rigid bodyand a second model corresponding to the second rigid body based on thefirst physical attribute and the second physical attribute.

Operation S202: Capture, by the physical engine, a collision pointbetween the first rigid body and the second rigid body, and determinenormal vector information corresponding to the collision point based oncollision data associated with the collision point.

Operation S203: Determine a first cutting surface in the initial cuttingmodel based on the collision point, the normal vector information, andmodel information of the initial cutting model, and cut the initialcutting model based on the first cutting surface.

For the specific embodiments of operation S201 to operation S203,reference may be made to the description about operation S101 tooperation S103 in the embodiment corresponding to FIG. 3 , and detailsare not described herein again.

Operation S204: Acquire a cutting end condition associated with thephysical engine, and take the first cutting model and the second cuttingmodel obtained by cutting as a target cutting model.

Operation S205: Determine, in response to the target cutting model notsatisfying the cutting end condition, a second cutting surface in thetarget cutting model based on second central position information of acentral point of the target cutting model, the normal vectorinformation, and the first cutting surface.

Specifically, the computer device may determine, in response to thetarget cutting model not satisfying the cutting end condition, secondcentral position information of a central point of the target cuttingmodel in the space coordinate system, and may then take a central pointcorresponding to the second central position information as a first keypoint. Furthermore, the computer device may also acquire a normal vectordirection and a normal vector length in the normal vector information,and may then take, along the normal vector direction, a coordinate pointcorresponding to position information at a distance from the secondcentral position information by the normal vector length as a second keypoint. Furthermore, the computer device may also acquire a second angle(e.g. π/4) for rotating the first cutting surface based on an angleinterval associated with the physical engine, rotate the first cuttingsurface based on the collision point, the normal vector information, andthe second angle to obtain a rotated first cutting surface, determine atarget intersection point having a minimum distance between the rotatedfirst cutting surface and the target cutting model, and positioninformation of the target intersection point, and then take the targetintersection point as a third key point. The computer device may thenconstruct a second surface-to-be-cut in the target cutting model basedon the first key point, the second key point, and the third key point,and determine a second cutting surface in the target cutting model basedon the second surface-to-be-cut.

The specific implementation of the computer device determining a secondcutting surface may be seen from the above specific implementation ofthe computer device determining a first cutting surface, and details arenot described herein again.

Operation S206: Cut the target cutting model based on the second cuttingsurface until a cut model satisfies the cutting end condition.

Specifically, the computer device may re-cut the target cutting modelbased on the second cutting surface, so as to obtain a re-cut model.When the re-cut model does not satisfy the cutting end condition, thecomputer device may take the re-cut model as a new target cutting model,and may then cut the new target cutting model until a target cuttingmodel satisfying the cutting end condition is obtained.

Operation S207: Obtain cutting data for presentation on a mobileterminal in response to the target cutting model satisfying the cuttingend condition.

FIG. 10 is a flowchart of collision data processing according to someembodiments. A computer device in some embodiments may be a computerdevice having a collision simulation function. The computer device maybe the server 10 shown in FIG. 1 .

It is to be understood that the computer device needs to performoperation S11 when simulating a collision simulation effect so as tointroduce a physical engine into a browser platform, and may thenperform operation S12 to bind a corresponding rigid body to eachoriginal model based on model information of original models created bya model creation engine associated with the browser platform, and oneoriginal model corresponds to one rigid body. Further, the computerdevice may perform operation S13 to refresh an animation image frame inthe browser platform so as to acquire a physical attribute of each rigidbody in real time, and may then perform operation S14 to acquireattribute information such as the position, linear velocity and angularvelocity of each rigid body from the physical attribute of each rigidbody. At this moment, the computer device may assign relevant attributeinformation (e.g. position information and rotation angle, etc.) in thephysical attribute of each rigid body to the original model boundtherewith through the physical engine, so as to control the originalmodel to perform a corresponding physical motion. Further, the computerdevice may perform operation S15 to update the position information androtation angle, etc. of the original model bound therewith by using thephysical attribute of the rigid body before each WebGL screen rendering.

When the physical engine detects that a first rigid body and a secondrigid body in the computer device collide, the computer device maydetermine an initial cutting model based on physical attributes of thetwo rigid bodies, and may then perform operation S16 to determine acollision point between the first rigid body and the second rigid bodyand to determine normal vector information corresponding to thecollision point based on collision data (e.g. a collision impulse and animpulse direction) associated with the collision point. Further, thecomputer device may perform operation S17 to determine a cutting surface(i.e. a first cutting surface) of the initial cutting model, and maythen perform operation S18 to divide, based on the first cuttingsurface, the initial cutting model into two models and to construct twobrand-new sub-models (for example, a first cutting model and a secondcutting model) by using cutting position information of a cutting pointof the initial cutting model and vertex position information of a vertexof the initial cutting model. Meanwhile, the computer device may alsoperform operation S18 to remove the cut old model (i.e. the initialcutting model).

The computer device may also acquire a cutting end condition associatedwith the physical engine and take the first cutting model and the secondcutting model as a target cutting model, and may then perform operationS20 to determine whether the target cutting model satisfies the cuttingend condition. When a model size of the target cutting model is lessthan or equal to a model size threshold in the cutting end condition (orthe number of cuts reaches a number-of-cuts threshold in the cutting endcondition), the computer device may determine that the target cuttingmodel satisfies the cutting end condition. At this moment, the computerdevice may perform operation S21 to end this cut.

When the model size of the target cutting model is greater than themodel size threshold in the cutting end condition (or the number of cutsdoes not reach the number-of-cuts threshold in the cutting endcondition), the computer device may determine that the target cuttingmodel does not satisfy the cutting end condition. At this moment, thecomputer device may re-perform operation S17 to determine a cuttingsurface (i.e. a second cutting surface) in the target cutting model notsatisfying the cutting end condition, and may then perform operationsS18-S19 to cut the target cutting model until the cut model satisfiesthe cutting end condition. The computer device may perform operation S21to end this cut.

In some embodiments, a physical engine introduced by a computer devicehaving a collision simulation function can acquire physical attributesof rigid bodies in real time. One rigid body corresponds to one originalmodel. When the physical engine detects that a first rigid body having afirst physical attribute collides with a second rigid body having asecond physical attribute, the computer device may determine an initialcutting model from a first model corresponding to the first rigid bodyand a second model corresponding to the second rigid body based on thefirst physical attribute and the second physical attribute, determine acollision point at which the first rigid body collides with the secondrigid body, and normal vector information corresponding to the collisionpoint based on the physical engine so as to determine a first cuttingsurface in the initial cutting model, and then cut the initial cuttingmodel based on the first cutting surface to obtain cutting data forpresentation on a mobile terminal, thereby simulating a simulationeffect of breaking the initial cutting model into fragments. The firstmodel and the second model in some embodiments are both independentoriginal models, rather than models built by multiple independentmodels. Therefore, in the process of collision simulation, the physicalengine may directly perform collision detection on the first rigid bodybound to the first model and the second rigid body bound to the secondmodel, without performing multiple collision detections on the firstmodel and the second model, whereby the number of collision detectionscan be effectively reduced, thereby reducing the computation amount ofthe computer device and improving the fluency of collision simulation.Furthermore, manual participation in model building is not required inthe creation process of the original models. Therefore, in the entireprocess of collision simulation, the labor cost can be reduced, and timeconsumed for model building can also be saved, so as to improve theefficiency of collision simulation.

FIG. 11 is a schematic structural diagram of a collision data processingapparatus according to some embodiments. As shown in FIG. 11 , thecollision data processing apparatus 1 may be a computer program(including a program code) operated in a computer device. For example,the collision data processing apparatus 1 is application software. Thecollision data processing apparatus 1 may be configured to perform thecorresponding operations in the method provided by some embodiments. Asshown in FIG. 11 , the collision data processing apparatus 1 may beoperated on a computer device having a collision simulation function.The computer device may be the server 10 in the embodiment correspondingto FIG. 1 . The collision data processing apparatus 1 may include: aninitial cutting model determining module 11, a normal vector informationdetermining module 12, a first cutting module 13, an original modelcreating module 14, a first binding module 15, a second binding module16, a physical attribute acquiring module 17, a collision regiondetermining module 18, a candidate contact pair determining module 19, acollision group determining module 20, a cutting surface determiningmodule 21, and a second cutting module 22.

The initial cutting model determining module 11 is configured todetermine, in response to a physical engine detecting that a first rigidbody having a first physical attribute collides with a second rigid bodyhaving a second physical attribute, an initial cutting model from afirst model corresponding to the first rigid body and a second modelcorresponding to the second rigid body based on the first physicalattribute and the second physical attribute.

The normal vector information determining module 12 is configured tocapture, by the physical engine, a collision point between the firstrigid body and the second rigid body, and determine normal vectorinformation corresponding to the collision point based on collision dataassociated with the collision point.

The normal vector information determining module 12 includes: acollision point capturing unit 121, a collision data determining unit122, and a normal vector information determining unit 123.

The collision point capturing unit 121 is configured to capture, by thephysical engine, a collision point at which the first rigid bodycollides with the second rigid body in a model coordinate system wherethe initial cutting model is located.

The collision data determining unit 122 is configured to acquire, by thephysical engine, a collision impulse generated in response to the firstrigid body colliding with the second rigid body, and an impulsedirection of the collision impulse, determine a normal vector length ofa normal vector associated with the collision point according to thecollision impulse, and determine a normal vector direction of the normalvector according to the impulse direction.

The normal vector information determining unit 123 is configured todetermine normal vector information corresponding to the collision pointbased on the normal vector direction and the normal vector length.

For the specific implementation of the collision point capturing unit121, the collision data determining unit 122, and the normal vectorinformation determining unit 123, reference may be made to thedescription about operation S102 in the embodiment corresponding to FIG.3 , and details are not described herein again.

The first cutting module 13 is configured to determine a first cuttingsurface in the initial cutting model based on the collision point, thenormal vector information, and model information of the initial cuttingmodel, and cut the initial cutting model based on the first cuttingsurface to obtain cutting data for presentation on a mobile terminal.The cutting data is used for representing a collision effect between thefirst model and the second model.

The first cutting module 13 includes: a space coordinate systemdetermining unit 131, a position information determining unit 132, afirst cutting surface determining unit 133, and a cutting unit 134.

The space coordinate system determining unit 131 is configured todetermine a space coordinate system with a central point of the initialcutting model as a coordinate origin in a model coordinate system wherethe initial cutting model is located.

The position information determining unit 132 is configured to determinefirst central position information of the central point of the initialcutting model in the space coordinate system based on relativecoordinate conversion information between the model coordinate systemand the space coordinate system, and determine collision positioninformation of the collision point in the space coordinate system.

The first cutting surface determining unit 133 is configured todetermine the first cutting surface in the initial cutting model basedon the first central position information, the collision positioninformation, and the normal vector information.

The normal vector information includes a normal vector length and anormal vector direction of a normal vector associated with the collisionpoint. The normal vector length is determined based on a collisionimpulse generated in response to the first rigid body colliding with thesecond rigid body. The normal vector direction is an impulse directionof the impact impulse.

The first cutting surface determining unit 133 includes: an auxiliarypoint determining subunit 1331, a surface-to-be-cut determining subunit1332, and a cutting surface determining subunit 1333.

The auxiliary point determining subunit 1331 is configured to determinea central point corresponding to the first central position informationas a first auxiliary point, determine the collision point correspondingto the collision position information as a second auxiliary point, andtake, along the normal vector direction, a coordinate pointcorresponding to position information at a distance from the collisionposition information by the normal vector length as a third auxiliarypoint.

The surface-to-be-cut determining subunit 1332 is configured todetermine a first surface-to-be-cut in the initial cutting model basedon the first auxiliary point, the second auxiliary point, and the thirdauxiliary point.

The cutting surface determining subunit 1333 is configured to acquire afirst angle for rotating the first surface-to-be-cut based on an angleinterval associated with the physical engine, rotate the firstsurface-to-be-cut according to the first angle by taking the normalvector as a rotation axis and taking the collision point as a rotationpoint, and take the rotated first surface-to-be-cut as the first cuttingsurface.

For the specific implementation of the auxiliary point determiningsubunit 1331, the surface-to-be-cut determining subunit 1332, and thecutting surface determining subunit 1333, reference may be made to thedescription about the first cutting surface in the embodimentcorresponding to FIG. 3 , and details are not described herein again.

The cutting unit 134 is configured to cut the initial cutting modelbased on the first cutting surface to obtain cutting data forpresentation on a mobile terminal.

The cutting unit 134 includes: a contour line determining subunit 1341,a cutting point acquiring subunit 1342, and a cutting subunit 1343.

The contour line determining subunit 1341 is configured to acquirevertex position information of a vertex of the initial cutting modelbased on the model information of the initial cutting model, anddetermine a contour line of the initial cutting model based on thevertex position information.

The cutting point acquiring subunit 1342 is configured to acquire acutting point between the contour line and the first cutting surface,and determine cutting position information of the cutting point in thespace coordinate system.

The cutting subunit 1343 is configured to cut the initial cutting modelinto a first cutting model and a second cutting model based on thecutting position information and the vertex position information, andobtain cutting data for presentation on the mobile terminal based on thefirst cutting model and the second cutting model.

The cutting subunit 1343 is further configured to:

determine, by a model creation engine, a geometric material of theinitial cutting model from the model information of the initial cuttingmodel;

determine a first coordinate array for constructing the first cuttingmodel and a second coordinate array for constructing the second cuttingmodel based on the cutting position information and the vertex positioninformation, the first cutting model and the second cutting model beingobtained by cutting the initial cutting model;

create a first geometric structure of the first cutting model by usingthe first coordinate array, and create a second geometric structure ofthe second cutting model by using the second coordinate array;

create the first cutting model based on the first geometric structureand the geometric material, create the second cutting model based on thesecond geometric structure and the geometric material, and determine thefirst cutting model and the second cutting model as a target cuttingmodel; and

acquire a cutting end condition associated with the physical engine, andobtain cutting data for presentation on a mobile terminal in response tothe target cutting model satisfying the cutting end condition.

The cutting subunit 1343 is further configured to:

acquire a cutting end condition associated with the physical engine, thecutting end condition including a model size threshold;

acquire a model size of the target cutting model, and in response to themodel size of the target cutting model being less than or equal to themodel size threshold, determine that the target cutting model satisfiesthe cutting end condition, and take the target cutting model satisfyingthe cutting end condition as a target model;

determine a target rigid body corresponding to the target model based onthe physical engine and target model information of the target model;and

acquire a physical attribute of the target rigid body, control thetarget model to execute a physical motion based on the physicalattribute of the target rigid body, acquire an animation image frameduring the execution of the physical motion, and obtain the cutting datafor presentation on the mobile terminal based on the animation imageframe.

For the specific implementation of the contour line determining subunit1341, the cutting point acquiring subunit 1342, and the cutting subunit1343, reference may be made to the description about cutting of theinitial cutting model in the embodiment corresponding to FIG. 3 , anddetails are not described herein again.

For the specific implementation of the space coordinate systemdetermining unit 131, the position information determining unit 132, thefirst cutting surface determining unit 133, and the cutting unit 134,reference may be made to the description about operation S103 in theembodiment corresponding to FIG. 3 , and details are not describedherein again.

The original model creating module 14 is configured to start a modelcreation engine associated with a browser platform, and create Noriginal models through the model creation engine. The N original modelsinclude the first model and the second model. N is an integer greaterthan or equal to 2.

The first binding module 15 is configured to determine first modelinformation of the first model based on the physical engine, determinefirst rigid body information of the first rigid body including the firstmodel according to the first model information, create the first rigidbody to be bound with the first model based on the first rigid bodyinformation, and bind the first rigid body with a first variableparameter in the first model. The first variable parameter is used forinstructing the physical engine to determine the first rigid bodycorresponding to the first model.

The second binding module 16 is configured to determine second modelinformation of the second model based on the physical engine, determinesecond rigid body information of the second rigid body including thesecond model according to the second model information, create thesecond rigid body to be bound with the second model based on the secondrigid body information, and bind the second rigid body with a secondvariable parameter in the second model. The second variable parameter isused for instructing the physical engine to determine the second rigidbody corresponding to the second model.

One original model corresponds to one rigid body.

The physical attribute acquiring module 17 is configured to acquirephysical attributes of N rigid bodies corresponding to the N originalmodels based on the physical engine; and determine a reference collisionrigid body from the N rigid bodies, and take rigid bodies other than thereference collision rigid body in the N rigid bodies as candidatecollision rigid bodies.

The collision region determining module 18 is configured to determine acollision region associated with the reference collision rigid bodybased on a physical attribute of the reference collision rigid body anda collision distance threshold corresponding to the physical engine.

The candidate contact pair determining module 19 is configured todetermine, in the presence of a candidate collision rigid body, fallinginto the collision region, among the candidate collision rigid bodies,the candidate collision rigid body falling into the collision region asa target collision rigid body, and form candidate contact pairs by thetarget collision rigid body and the reference collision rigid body.

The collision group determining module 20 is configured to acquire acollision detection condition, perform collision detection on thecandidate contact pairs based on the collision detection condition,screen a candidate contact pair satisfying the collision detectioncondition from the respective candidate contact pairs, and take thescreened candidate contact pair as a collision group. The referencecollision rigid body in the collision group is the first rigid body. Thetarget collision rigid body in the collision group is the second rigidbody.

The collision group determining module 20 includes: a collisiondetection unit 201, a predicted distance determining unit 202, adetection condition acquiring unit 203, and a collision groupdetermining unit 204.

The collision detection unit 201 is configured to perform collisiondetection on the target collision rigid body and the reference collisionrigid body in the candidate contact pairs based on a physical attributeof the target collision rigid body in the candidate contact pairs andthe physical attribute of the reference collision rigid body in thecandidate contact pairs.

The predicted distance determining unit 202 is configured to determine afirst predicted contact point in the target collision rigid body,determine a second predicted contact point corresponding to the firstpredicted contact point in the reference collision rigid body, anddetermine a predicted distance between the first predicted contact pointand the second predicted contact point through the physical engine.

The detection condition acquiring unit 203 is configured to acquire acollision detection condition. The collision detection condition is usedfor screening candidate contact pairs having non-positive predicteddistances.

The collision group determining unit 204 is configured to screen acandidate contact pair satisfying the collision detection condition asthe collision group from the respective candidate contact pairs.

For the specific implementation of the collision detection unit 201, thepredicted distance determining unit 202, the detection conditionacquiring unit 203, and the collision group determining unit 204,reference may be made to the description about the collision group inthe embodiment corresponding to FIG. 5 , and details are not describedherein again.

The cutting surface determining module 21 is configured to determine,based on the target cutting model not satisfying the cutting endcondition, a second cutting surface in the target cutting model based onsecond central position information of a central point of the targetcutting model, the normal vector information, and the first cuttingsurface.

The cutting surface determining module 21 includes: a first key pointdetermining unit 211, a second key point determining unit 212, a thirdkey point determining unit 213, and a second cutting surface determiningunit 214.

The first key point determining unit 211 is configured to determine,based on the target cutting model not satisfying the cutting endcondition, second central position information of a central point of thetarget cutting model in the space coordinate system, and take a centralpoint corresponding to the second central position information as afirst key point.

The second key point determining unit 212 is configured to acquire anormal vector direction and a normal vector length in the normal vectorinformation, and take, along the normal vector direction, a coordinatepoint corresponding to position information at a distance from thesecond central position information by the normal vector length as asecond key point.

The third key point determining unit 213 is configured to acquire asecond angle for rotating the first cutting surface based on an angleinterval associated with the physical engine, rotate the first cuttingsurface based on the collision point, the normal vector information, andthe second angle to obtain a rotated first cutting surface, determine atarget intersection point having a minimum distance between the rotatedfirst cutting surface and the target cutting model, and positioninformation of the target intersection point, and take the targetintersection point as a third key point.

The second cutting surface determining unit 214 is configured toconstruct a second surface-to-be-cut in the target cutting model basedon the first key point, the second key point, and the third key point,and determine a second cutting surface in the target cutting model basedon the second surface-to-be-cut.

For the specific implementation of the first key point determining unit211, the second key point determining unit 212, the third key pointdetermining unit 213, and the second cutting surface determining unit214, reference may be made to the description about S205 in theembodiment corresponding to FIG. 9 , and details are not describedherein again.

The second cutting module 22 is configured to cut the target cuttingmodel based on the second cutting surface until a cut model satisfiesthe cutting end condition.

For the specific implementation of the initial cutting model determiningmodule 11, the normal vector information determining module 12, thefirst cutting module 13, the original model creating module 14, thefirst binding module 15, the second binding module 16, the physicalattribute acquiring module 17, the collision region determining module18, the candidate contact pair determining module 19, the collisiongroup determining module 20, the cutting surface determining module 21,and the second cutting module 22, reference may be made to thedescription about operations S201-S207 in the embodiment correspondingto FIG. 9 , and details are not described herein again. In addition, thedescription of beneficial effects of the same method is not describedherein again.

FIG. 12 is a schematic diagram of a computer device according to someembodiments. As shown in FIG. 12 , the computer device 1000 may be aserver 10 in the embodiment corresponding to FIG. 1 . The computerdevice 1000 may include: at least one processor 1001, such as a CPU, atleast one network interface 1004, a user interface 1003, a memory 1005,and at least one communication bus 1002. The communication bus 1002 isconfigured to implement connection and communication between thecomponents. The user interface 1003 may include a display, a keyboard,and the network interface 1004 may include a standard wired interfaceand a standard wireless interface (for example, a Wi-Fi interface). Thememory 1005 may be a high-speed RAM memory, or may be a non-volatilememory, for example, at least one magnetic disk memory. In someembodiments, the memory 1005 may further be at least one storageapparatus away from the foregoing processor 1001. As shown in FIG. 12 ,the memory 1005 used as a computer storage medium may include anoperating system, a network communication module, a user interfacemodule, and a device-control application program.

In the computer device 1000 shown in FIG. 12 , the network interface1004 is mainly configured to perform network communication. The userinterface 1003 is mainly configured to provide an input interface for auser. The processor 1001 may be configured to call the device controlapplication program stored in the memory 1005 to implement the foregoingdescribed method embodiments.

It is to be understood that the computer device 1000 described in someembodiments can implement the descriptions of the collision dataprocessing method in the foregoing embodiment corresponding to FIG. 3and FIG. 9 , and can also implement the descriptions of the collisiondata processing apparatus 1 in the foregoing embodiment corresponding toFIG. 11 . Details are not described herein again. In addition, thedescription of beneficial effects of the same method is not describedherein again.

Some embodiments further provide a computer-readable storage medium, thecomputer-readable storage medium storing a computer program, thecomputer program including program instructions, the programinstructions, when executed by a processor, performing the datatransmission method provided by each operation in FIG. 3 and FIG. 9 .For a specific implementation, refer to the operations in FIG. 3 andFIG. 9 . Details are not described herein again.

The computer-readable storage medium may be a data transmissionapparatus provided in any one of the foregoing embodiments or aninternal storage unit of the computer device, for example, a hard diskor a main memory of the computer device. The computer-readable storagemedium may alternatively be an external storage device of the computerdevice, for example, a removable hard disk, a smart memory card (SMC), asecure digital (SD) card, or a flash card equipped on the computerdevice. Further, the computer-readable storage medium may furthercomprise both an internal storage unit and an external storage device ofthe computer device. The computer-readable storage medium is configuredto store the computer program and another program and data that arerequired by the computer device. The computer-readable storage mediummay further be configured to temporarily store data that has been outputor data to be output.

Some embodiments may provide a computer program product or a computerprogram, the computer program product or the computer program includingcomputer instructions, the computer instructions being stored in acomputer-readable storage medium. A processor of a computer device readsthe computer instructions from the computer-readable storage medium, andexecutes the computer instructions, to cause the computer device toperform the descriptions of the collision data processing method in theembodiment corresponding to FIG. 3 or FIG. 9 . Details are not describedherein again. In addition, the description of beneficial effects of thesame method is not described herein again.

A person of ordinary skill in the art may understand that all or some ofthe processes of the methods in the embodiments may be implemented by acomputer program instructing relevant hardware. The program may bestored in a computer-readable storage medium. When the program isexecuted, the procedures of the foregoing method embodiments areperformed. The foregoing storage medium may include a magnetic disc, anoptical disc, a read-only memory (ROM), a random access memory (RAM), orthe like.

The foregoing embodiments are used for describing, instead of limitingthe technical solutions of the disclosure. A person of ordinary skill inthe art shall understand that although the disclosure has been describedin detail with reference to the foregoing embodiments, modifications canbe made to the technical solutions described in the foregoingembodiments, or equivalent replacements can be made to some technicalfeatures in the technical solutions, provided that such modifications orreplacements do not cause the essence of corresponding technicalsolutions to depart from the spirit and scope of the technical solutionsof the embodiments of the disclosure.

What is claimed is:
 1. A collision data processing method, performed bya computer device, the collision data processing method comprising:determining, based on a physical engine detecting that a first rigidbody having a first physical attribute collides with a second rigid bodyhaving a second physical attribute, an initial cutting model from afirst model corresponding to the first rigid body and a second modelcorresponding to the second rigid body based on the first physicalattribute and the second physical attribute; capturing, by the physicalengine, a collision point between the first rigid body and the secondrigid body, and determining normal vector information corresponding tothe collision point based on collision data associated with thecollision point; and determining a first cutting surface in the initialcutting model based on the collision point, the normal vectorinformation, and model information of the initial cutting model, andcutting the initial cutting model based on the first cutting surface toobtain cutting data for presentation on a mobile terminal, the cuttingdata representing a collision effect between the first model and thesecond model.
 2. The collision data processing method according to claim1, further comprising: starting a model creation engine, and creating Noriginal models through the model creation engine, the N original modelscomprising the first model and the second model, and N being an integergreater than or equal to 2; determining first model information of thefirst model based on the physical engine, determining first rigid bodyinformation of the first rigid body comprising the first model accordingto the first model information, creating the first rigid body to bebound with the first model based on the first rigid body information,and binding the first rigid body with a first variable parameter in thefirst model, the first variable parameter instructing the physicalengine to determine the first rigid body corresponding to the firstmodel; and determining second model information of the second modelbased on the physical engine, determining second rigid body informationof the second rigid body comprising the second model according to thesecond model information, creating the second rigid body to be boundwith the second model based on the second rigid body information, andbinding the second rigid body with a second variable parameter in thesecond model, the second variable parameter instructing the physicalengine to determine the second rigid body corresponding to the secondmodel.
 3. The collision data processing method according to claim 2,further comprising: acquiring physical attributes of N rigid bodiescorresponding to the N original models based on the physical engine;determining a reference collision rigid body from the N rigid bodies,and taking rigid bodies other than the reference collision rigid body inthe N rigid bodies as candidate collision rigid bodies; determining acollision region associated with the reference collision rigid bodybased on a physical attribute of the reference collision rigid body anda collision distance threshold corresponding to the physical engine;determining, in a presence of a candidate collision rigid body, fallinginto the collision region, among the candidate collision rigid bodies,the candidate collision rigid body falling into the collision region asa target collision rigid body, and forming candidate contact pairs bythe target collision rigid body and the reference collision rigid body;and acquiring a collision detection condition, performing collisiondetection on the candidate contact pairs based on the collisiondetection condition, screening a candidate contact pair satisfying thecollision detection condition from the respective candidate contactpairs, and taking the screened candidate contact pair as a collisiongroup, the reference collision rigid body in the collision group beingthe first rigid body, and the target collision rigid body in thecollision group being the second rigid body.
 4. The collision dataprocessing method according to claim 3, wherein the acquiring thecollision detection condition comprises: performing collision detectionon the target collision rigid body and the reference collision rigidbody in the candidate contact pairs based on a physical attribute of thetarget collision rigid body in the candidate contact pairs and thephysical attribute of the reference collision rigid body in thecandidate contact pairs; determining a first predicted contact point inthe target collision rigid body, determining a second predicted contactpoint corresponding to the first predicted contact point in thereference collision rigid body, and determining a predicted distancebetween the first predicted contact point and the second predictedcontact point through the physical engine; acquiring the collisiondetection condition, the collision detection condition screening thecandidate contact pairs having non-positive predicted distances; andscreening the candidate contact pair satisfying the collision detectioncondition as the collision group from the respective candidate contactpairs.
 5. The collision data processing method according to claim 1,wherein the capturing comprises: capturing, by the physical engine, thecollision point at which the first rigid body collides with the secondrigid body in a model coordinate system where the initial cutting modelis located; acquiring, by the physical engine, a collision impulsegenerated based on the first rigid body colliding with the second rigidbody, and an impulse direction of the collision impulse, and taking thecollision impulse and the impulse direction as collision data associatedwith the collision point; determining a normal vector length of a normalvector associated with the collision point according to the collisionimpulse, and determining a normal vector direction of the normal vectoraccording to the impulse direction; and determining the normal vectorinformation corresponding to the collision point based on the normalvector direction and the normal vector length.
 6. The collision dataprocessing method according to claim 1, wherein the determining thefirst cutting surface in the initial cutting model comprises:determining a space coordinate system with a central point of theinitial cutting model as a coordinate origin in a model coordinatesystem where the initial cutting model is located; determining firstcentral position information of the central point of the initial cuttingmodel in the space coordinate system based on relative coordinateconversion information between the model coordinate system and the spacecoordinate system, and determining collision position information of thecollision point in the space coordinate system; determining the firstcutting surface in the initial cutting model based on the first centralposition information, the collision position information, and the normalvector information; and cutting the initial cutting model based on thefirst cutting surface to obtain the cutting data.
 7. The collision dataprocessing method according to claim 6, wherein the normal vectorinformation comprises a normal vector length and a normal vectordirection of a normal vector associated with the collision point; thenormal vector length is determined based on a collision impulsegenerated based on the first rigid body colliding with the second rigidbody; the normal vector direction is an impulse direction of an impactimpulse; the determining the first cutting surface in the initialcutting model comprises: determining a central point corresponding tothe first central position information as a first auxiliary point,determining the collision point corresponding to the collision positioninformation as a second auxiliary point, and taking, along the normalvector direction, a coordinate point corresponding to positioninformation at a distance from the collision position information by thenormal vector length as a third auxiliary point; determining a firstsurface-to-be-cut in the initial cutting model based on the firstauxiliary point, the second auxiliary point, and the third auxiliarypoint; and acquiring a first angle for rotating the firstsurface-to-be-cut based on an angle interval associated with thephysical engine, rotating the first surface-to-be-cut according to thefirst angle by taking the normal vector as a rotation axis and takingthe collision point as a rotation point, and taking the rotated firstsurface-to-be-cut as the first cutting surface.
 8. The collision dataprocessing method according to claim 6, wherein the cutting the initialcutting model comprises: acquiring vertex position information of avertex of the initial cutting model based on the model information ofthe initial cutting model, and determining a contour line of the initialcutting model based on the vertex position information; acquiring acutting point between the contour line and the first cutting surface,and determining cutting position information of the cutting point in thespace coordinate system; and cutting the initial cutting model into afirst cutting model and a second cutting model based on the cuttingposition information and the vertex position information, and obtainingthe cutting data based on the first cutting model and the second cuttingmodel.
 9. The collision data processing method according to claim 8,wherein the cutting the initial cutting model into the first cuttingmodel and the second cutting model comprises: determining, by a modelcreation engine, a geometric material of the initial cutting model fromthe model information of the initial cutting model; determining a firstcoordinate array for constructing the first cutting model and a secondcoordinate array for constructing the second cutting model based on thecutting position information and the vertex position information, thefirst cutting model and the second cutting model being obtained bycutting the initial cutting model; creating a first geometric structureof the first cutting model by using the first coordinate array, andcreating a second geometric structure of the second cutting model byusing the second coordinate array; creating the first cutting modelbased on the first geometric structure and the geometric material,creating the second cutting model based on the second geometricstructure and the geometric material, and determining the first cuttingmodel and the second cutting model as a target cutting model; andacquiring a cutting end condition associated with the physical engine,and obtaining the cutting data based on the target cutting modelsatisfying the cutting end condition.
 10. The collision data processingmethod according to claim 9, wherein the acquiring the cutting endcondition associated with the physical engine comprises: acquiring thecutting end condition associated with the physical engine, the cuttingend condition comprising a model size threshold; acquiring a model sizeof the target cutting model, and based on the model size of the targetcutting model being less than or equal to the model size threshold,determining that the target cutting model satisfies the cutting endcondition, and taking the target cutting model as a target model;determining a target rigid body corresponding to the target model basedon the physical engine and target model information of the target model;and acquiring a physical attribute of the target rigid body, controllingthe target model to execute a physical motion based on the physicalattribute of the target rigid body, acquiring an animation image frameduring the execution of the physical motion, and obtaining the cuttingdata based on the animation image frame.
 11. The collision dataprocessing method according to claim 9, further comprising: based on thetarget cutting model not satisfying the cutting end condition,determining a second cutting surface in the target cutting model basedon second central position information of a central point of the targetcutting model, the normal vector information, and the first cuttingsurface; and cutting the target cutting model based on the secondcutting surface until a cut model satisfies the cutting end condition.12. The collision data processing method according to claim 1, furthercomprising: based on a target cutting model not satisfying a cutting endcondition, determining a second cutting surface in the target cuttingmodel based on second central position information of a central point ofthe target cutting model, the normal vector information, and the firstcutting surface; and cutting the target cutting model based on thesecond cutting surface until a cut model satisfies the cutting endcondition.
 13. A collision data processing apparatus comprising: atleast one memory configured to store program code; and at least oneprocessor configured to read the program code and operate as instructedby the program code, the program code comprising: initial cutting modeldetermining code configured to cause at least one of the at least oneprocessor to determine, based on a physical engine detecting that afirst rigid body having a first physical attribute collides with asecond rigid body having a second physical attribute, an initial cuttingmodel from a first model corresponding to the first rigid body and asecond model corresponding to the second rigid body based on the firstphysical attribute and the second physical attribute; normal vectorinformation determining code configured to cause at least one of the atleast one processor to capture, by the physical engine, a collisionpoint between the first rigid body and the second rigid body, anddetermine normal vector information corresponding to the collision pointbased on collision data associated with the collision point; and firstcutting code configured to cause at least one of the at least oneprocessor to determine a first cutting surface in the initial cuttingmodel based on the collision point, the normal vector information, andmodel information of the initial cutting model, and cut the initialcutting model based on the first cutting surface to obtain cutting datafor presentation on a mobile terminal, the cutting data representing acollision effect between the first model and the second model.
 14. Thecollision data processing apparatus according to claim 13, wherein theprogram code further comprises: original model creating code configuredto cause at least one of the at least one processor to start a modelcreation engine, and create N original models through the model creationengine, the N original models comprising the first model and the secondmodel, and N being an integer greater than or equal to 2; first bindingcode configured to cause at least one of the at least one processor todetermine first model information of the first model based on thephysical engine, determine first rigid body information of the firstrigid body comprising the first model according to the first modelinformation, create the first rigid body to be bound with the firstmodel based on the first rigid body information, and bind the firstrigid body with a first variable parameter in the first model, the firstvariable parameter instructing the physical engine to determine thefirst rigid body corresponding to the first model; and second bindingcode configured to cause at least one of the at least one processor todetermine second model information of the second model based on thephysical engine, determine second rigid body information of the secondrigid body comprising the second model according to the second modelinformation, create the second rigid body to be bound with the secondmodel based on the second rigid body information, and bind the secondrigid body with a second variable parameter in the second model, thesecond variable parameter instructing the physical engine to determinethe second rigid body corresponding to the second model.
 15. Thecollision data processing apparatus according to claim 14, wherein theprogram code further comprises: physical attribute acquiring codeconfigured to cause at least one of the at least one processor toacquire physical attributes of N rigid bodies corresponding to the Noriginal models based on the physical engine; determine a referencecollision rigid body from the N rigid bodies, and take rigid bodiesother than the reference collision rigid body in the N rigid bodies ascandidate collision rigid bodies; collision region determining codeconfigured to cause at least one of the at least one processor todetermine a collision region associated with the reference collisionrigid body based on a physical attribute of the reference collisionrigid body and a collision distance threshold corresponding to thephysical engine; candidate contact pair determining code configured tocause at least one of the at least one processor to determine, in apresence of a candidate collision rigid body, falling into the collisionregion, among the candidate collision rigid bodies, the candidatecollision rigid body falling into the collision region as a targetcollision rigid body, and form candidate contact pairs by the targetcollision rigid body and the reference collision rigid body; andcollision group determining code configured to cause at least one of theat least one processor to acquire a collision detection condition,perform collision detection on the candidate contact pairs based on thecollision detection condition, screen a candidate contact pairsatisfying the collision detection condition from the respectivecandidate contact pairs, and take the screened candidate contact pair asa collision group, the reference collision rigid body in the collisiongroup being the first rigid body, and the target collision rigid body inthe collision group being the second rigid body.
 16. The collision dataprocessing apparatus according to claim 15, wherein the collision groupdetermining code further configured to cause at least one of the atleast one processor to: perform collision detection on the targetcollision rigid body and the reference collision rigid body in thecandidate contact pairs based on a physical attribute of the targetcollision rigid body in the candidate contact pairs and the physicalattribute of the reference collision rigid body in the candidate contactpairs; determine a first predicted contact point in the target collisionrigid body, determine a second predicted contact point corresponding tothe first predicted contact point in the reference collision rigid body,and determine a predicted distance between the first predicted contactpoint and the second predicted contact point through the physicalengine; acquire the collision detection condition, the collisiondetection condition screening the candidate contact pairs havingnon-positive predicted distances; and screen the candidate contact pairsatisfying the collision detection condition as the collision group fromthe respective candidate contact pairs.
 17. The collision dataprocessing apparatus according to claim 13, wherein the normal vectorinformation determining code is further configured to cause at least oneof the at least one processor to: capture, by the physical engine, thecollision point at which the first rigid body collides with the secondrigid body in a model coordinate system where the initial cutting modelis located; acquire, by the physical engine, a collision impulsegenerated based on the first rigid body colliding with the second rigidbody, and an impulse direction of the collision impulse; determine anormal vector length of a normal vector associated with the collisionpoint according to the collision impulse, and determine a normal vectordirection of the normal vector according to the impulse direction; anddetermine the normal vector information corresponding to the collisionpoint based on the normal vector direction and the normal vector length.18. The collision data processing apparatus according to claim 13,wherein the program code further comprises: cutting surface determiningcode configured to cause at least one of the at least one processor todetermine, based on a target cutting model not satisfying a cutting endcondition, a second cutting surface in the target cutting model based onsecond central position information of a central point of the targetcutting model, the normal vector information, and the first cuttingsurface; and second cutting code configured to cause at least one of theat least one processor to cut the target cutting model based on thesecond cutting surface until a cut model satisfies the cutting endcondition.
 19. A non-transitory computer-readable storage medium,storing computer code that, when executed by at least one processor,causes the at least one processor to at least: determine, based on aphysical engine detecting that a first rigid body having a firstphysical attribute collides with a second rigid body having a secondphysical attribute, an initial cutting model from a first modelcorresponding to the first rigid body and a second model correspondingto the second rigid body based on the first physical attribute and thesecond physical attribute; capture, by the physical engine, a collisionpoint between the first rigid body and the second rigid body, anddetermine normal vector information corresponding to the collision pointbased on collision data associated with the collision point; anddetermine a first cutting surface in the initial cutting model based onthe collision point, the normal vector information, and modelinformation of the initial cutting model, and cut the initial cuttingmodel based on the first cutting surface to obtain cutting data forpresentation on a mobile terminal, the cutting data representing acollision effect between the first model and the second model.
 20. Thenon-transitory computer-readable storage medium according to claim 19,wherein the computer code is further configured to, when executed by theat least one processor, cause the at least one processor to at least:determine, based on a target cutting model not satisfying a cutting endcondition, a second cutting surface in the target cutting model based onsecond central position information of a central point of the targetcutting model, the normal vector information, and the first cuttingsurface; and cut the target cutting model based on the second cuttingsurface until a cut model satisfies the cutting end condition.